package numbers;

import org.testng.Assert;
import org.testng.annotations.Test;

import java.*;
/**
 * Created by Nicktoris on 22.06.2014.
 */
public class PrimeNumbers {
    public static boolean num(int y) {
        int t = y;
        int i = 0;
        if (t / t == 1)
            i = i + 1;
        if ((t == 2) || (t == 3) || (t == 5) || (t == 7))
            i = i - 1;
        if ((t % 2 == 0) || (t % 3 == 0) || (t % 7 == 0) || (t % 5 == 0))
            i = i + 1;
        if (t / 1 == t)
            i = i + 1;

        System.out.println(i);
        if (i == 2) {
            System.out.println(y + "is Prime number");
            return true;
        } else {
            System.out.println(y + "is not Prime number");
            return false;
        }
    }

    @Test
    public void info() {

        Assert.assertTrue(num(7));
    }
}
